package org.yenn.pattern.utils;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

/**
 * @Author: yerenyun
 * @Description: ISOconvert to utf-8
 */
public class CodeUtil {
    public static String convert(String src) throws UnsupportedEncodingException {
        return new String(src.getBytes("ISO-8859-1"),"UTF-8");
    }

    public static String convertIso(String src) throws UnsupportedEncodingException {
        return new String(src.getBytes("UTF-8"),"ISO-8859-1");
    }

    public static String convertGBK(String src) throws UnsupportedEncodingException {
        return new String(src.getBytes("UTF-8"),"GBK");
    }
}
